package com.leap.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@Builder
@TableName("media")
@Schema(description = "媒体资源类")
public class Media {
    //雪花算法
    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @TableField("media_url")
    private String mediaUrl;

    @TableField("media_type")
    @Schema(description = "媒体资源类型 0图片 1视频")
    private int mediaType;

    private String description;

    @Schema(description = "为视频类型时 视频时长")
    private Long duration;

    private Double width;

    private Double height;

    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private LocalDateTime createTime;

}
